// components/navi/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title: String,
    first: Boolean,
    latest: Boolean
  },

  /**
   * 组件的初始数据
   */
  data: {
    disLeftSrc: 'images/triangle.dis@left.png',
    leftSrc: 'images/triangle@left.png',
    rightSrc: 'images/triangle@right.png',
    disrightSrc: 'images/triangle.dis@right.png'
  },
  detached () {

  },
  /**
   * 组件的方法列表
   */
  methods: {
    onLeft(e) {
      if (!this.properties.latest) {
        this.triggerEvent("onLeft", {
          latest: this.properties.latest
        })
      }

    },
    onRight(e) {
      if (!this.properties.first) {
        this.triggerEvent("onRight", {
          first: this.properties.first
        })
      }

    }
  }
})